package file;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

/**
 * Created with IntelliJ IDEA
 * Description：字符流读文件
 * User：chenshu
 * Date：2023-11-15
 * Time：22:36
 */
public class Demo2 {
    public static void main(String[] args) throws IOException {
        Reader reader = new FileReader("test.txt");
        char[] buf = new char[1024];
        int len = reader.read(buf);
        for (int i = 0; i < len; i++) {
            System.out.println(buf[i]);
        }
    }
}
